#include <iostream>
using namespace std;

class A{
public:
	int m_public;
protected:
	int m_protected;
private:
	int m_private;
};

class B:public A{
public:
	void func(void) {
		m_public = 123;
		m_protected = 123;
		//m_private  = 123;
	}
};

class C:protected A {
public:
	void func(void) {
		m_public = 123;
		m_protected = 123;
		//m_private  = 123;
	}
};

class D:private A{
public:
	void func(void) {
		m_public = 123;
		m_protected = 123;
		//m_private  = 123;
	}
};


class X:public B{
public:
	void func(void) {
		m_public = 123;
		m_protected = 123;
		//m_private  = 123;
	}
};

class Y:public C{
public:
	void func(void) {
		m_public = 123;
		m_protected = 123;
		//m_private  = 123;
	}
};

class Z:public D {
public:
	void func(void) {
		//m_public = 123;
		//m_protected = 123;
		//m_private  = 123;
	}
};

int main (void)
{
	B b;
	b.m_public = 321;
	cout << b.m_public << endl;
	//b.m_protected = 123;
	//b.m_private = 123;

	C c;
	//c.m_public = 123;
	//c.m_protected = 123;
	//c.m_private = 123;

	D d;
}

